package org.example;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.CommandLineRunner;
import org.springframework.stereotype.Component;

/**
 * @author junjie.yang
 * @date 2023/12/26
 */
@Component
public class OrderRunner implements CommandLineRunner {
    @Autowired
    private OrderService orderService;
    @Override
    public void run(String... args) throws Exception {
        orderService.create();
        orderService.pay(1L);
        orderService.deliver(1L);
        orderService.receive(1L);

        orderService.create();
        orderService.pay(2L);
        orderService.deliver(2L);
        orderService.receive(2L);
        System.out.println("全部订单状态："+ orderService.getOrders());
    }
}
